package com.lagou.config.service.impl;

import com.lagou.common.util.DataBaseConfig;
import com.lagou.common.zk.ConfigCenter;
import com.lagou.config.service.ConfigServer;
import org.springframework.stereotype.Service;

@Service
public class ConfigServerImpl implements ConfigServer {

    @Override
    public DataBaseConfig getDataBaseConfig() throws Exception {
        return ConfigCenter.getConfig();
    }

    @Override
    public void setDataBaseConfig(DataBaseConfig config) throws Exception {
        ConfigCenter.updateConfig(config);
    }
}
